import Vue from 'vue'
// import store from './store'
import Router from 'vue-router'
import Home from './views/Home.vue'
const FuLiMall = () => import('./views/FuLiMall.vue')
// const mallIndex = () => import('./components/mall_index.vue')
// const mallNav = () => import('./components/mall_navs.vue')
// const mallPuShuo = () => import('./components/mall_pushuo.vue')
const SearchBox = () => import('./views/Search.vue')
const CategoryLists = () => import('./views/CategoryLists.vue')
const ProductDetail = () => import('./views/ProductDetail.vue')
const Payment = () => import('./views/Payment.vue')
const AdressLists = () => import('./views/AdressLists.vue')
const AdressSet = () => import('./views/AdressSet.vue')
const UserSet = () => import('./components/Mine/UserSet.vue')
const IframeView = () => import('./views/IframeView.vue')
const Login = () => import('./components/Login/Login.vue')
const ResetAcount = () => import('./components/Login/ResetAcount.vue')
const Register = () => import('./components/Login/Register.vue')
const Success = () => import('./components/Login/Success.vue')

Vue.use(Router)

export default new Router({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes: [
    {
      path: '/',
      component: Home,
      children: [
        {
          path: '',
          name: 'mallIndex',
          component: () => import('./components/TabPublic/Home.vue'),
          meta: {
            showTab: true,
            title: '基因谱'
          }
        },
        {
          path: 'category',
          name: 'Category',
          component: () => import('./components/TabPublic/Category.vue'),
          meta: {
            showTab: true,
            title: '产品分类'
          }
        },
        {
          path: 'fulipage',
          name: 'FuLiPage',
          component: () => import('./components/TabPublic/FuLiPage.vue'),
          meta: {
            showTab: false,
            title: '福利商城'
          }
        },
        {
          path: 'cart',
          name: 'Cart',
          component: () => import('./components/TabPublic/Cart.vue'),
          meta: {
            showTab: false,
            title: '购物车'
          }
        },
        {
          path: 'mine',
          name: 'Mine',
          component: () => import('./components/TabPublic/Mine.vue'),
          meta: {
            showTab: true,
            title: '个人中心'
          }
        }
      ]
    },
    {
      path: '/fulimall',
      component: FuLiMall,
      children: [
        {
          path: '',
          name: 'mallIndexFuLi',
          component: () => import('./components/TabStaff/Home.vue'),
          meta: {
            showTab: true,
            title: '福利商城'
          }
        },
        {
          path: 'category',
          name: 'CategoryFuLi',
          component: () => import('./components/TabStaff/Category.vue'),
          meta: {
            showTab: true,
            title: '商品分类'
          }
        },
        {
          path: 'cart',
          name: 'CartFuLi',
          component: () => import('./components/TabStaff/Cart.vue'),
          meta: {
            showTab: true,
            title: '购物车'
          }
        },
        {
          path: 'mine',
          name: 'MineFuLi',
          component: () => import('./components/TabStaff/Mine.vue'),
          meta: {
            showTab: true,
            title: '个人中心'
          }
        }
      ]
    },
    {
      path: '/searchbox',
      name: 'searchbox',
      component: SearchBox,
      meta: {
        title: '搜索'
      }
    },
    {
      path: '/userset',
      name: 'userset',
      component: UserSet,
      meta: {
        title: '设置'
      }
    },
    {
      path: '/lists/:id',
      name: 'categorylists',
      component: CategoryLists
    },
    {
      path: '/productdetail/:id',
      name: 'productdetail',
      component: ProductDetail
    },
    {
      path: '/payment',
      name: 'payment',
      component: Payment,
      meta: {
        title: '我的订单',
        requiresAuth: true
      }
    },
    {
      path: '/adressLists',
      name: 'adressLists',
      component: AdressLists
    },
    {
      path: '/login',
      name: 'login',
      component: Login,
      meta: {
        title: '登录'
      }
    },
    {
      path: '/resetacount',
      name: 'resetacount',
      component: ResetAcount,
      meta: {
        title: '密码设置'
      }
    },
    {
      path: '/register',
      name: 'register',
      component: Register,
      meta: {
        title: '注册'
      }
    },
    {
      path: '/success',
      name: 'success',
      component: Success,
      meta: {
        title: '注册成功'
      }
    },
    {
      path: '/iframe',
      name: 'iframe',
      component: IframeView,
      meta: {
        title: '基因谱'
      }
    },
    {
      path: '/adressSet/:item',
      name: 'adressSet',
      component: AdressSet,
      meta: {
        title: '收货地址'
      }
    }
  ]
})
